package com.study.abstractfactory.factory;

import com.study.abstractfactory.product.*;

/**
 * @ClassName: ColorFactory
 * @Description: 颜色工厂
 * @Details:
 * @Author: 郑港旭
 * @Create: 2021-11-16 09:40
 **/
public class ColorFactory extends AbstractFactory{
    @Override
    public Shape getShape(String shape) {
        return null;
    }

    @Override
    public Color getColor(String color) {
        if (color == null){
            return null;
        }
        switch (color) {
            case "RED":
                return new Red();
            case "BLUE":
                return new Blue();
            case "GREEN":
                return new Green();
        }
        return null;
    }
}
